<template>
  <div
    id="app"
    v-cloak
  >
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive" />
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive" />

    <Tabbar
      class="tab"
      v-if="!$route.meta.isShow"
    />
  </div>
</template>


<script>
import Tabbar from "@/components/tabbar";
import axios from "axios";
import { Toast } from "vant";
export default {
  name: "App",
  data() {
    return {
      
    };
  },
  created() {
    this.getUserID();
  },
  beforeUpdate() {
    dd.biz.navigation.setRight({
      show: false //控制按钮显示， true 显示， false 隐藏， 默认true
    });
  },
  methods: {
    
    getUserID() {
      if (dd.env.platform == "notInDingTalk") {
      Toast("请用手机钉钉打开！");
      this.$router.replace("/error");
      return false;
      }
    },
  },
  components: {
    Tabbar
  }
};
</script>

<style scoped lang="less">
* {
  -webkit-touch-callout: none; /*系统默认菜单被禁用*/
  -webkit-user-select: none; /*webkit浏览器*/
  -khtml-user-select: none; /*早期浏览器*/
  -moz-user-select: none; /*火狐*/
  -ms-user-select: none; /*IE10*/
  user-select: none;
}
input,
textarea {
  -webkit-user-select: auto; /*webkit浏览器*/
  margin: 0px;
  padding: 0px;
  outline: none;
}
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif, "PingFang SC";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100%;
  padding-bottom: env(safe-area-inset-bottom);
  margin-bottom: env(safe-area-inset-bottom);
  @media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
    .tab {
      position: fixed;
      top: 89vh;
      z-index: 1;
      margin-bottom: env(safe-area-inset-bottom);
      padding-bottom: 5vh;
    }
  }
  @media only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) {
    .tab {
      position: fixed;
      top: 89vh;
      z-index: 1;
      margin-bottom: env(safe-area-inset-bottom);
      padding-bottom: 5vh;
    }
  }
  @media only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) {
    .tab {
      position: fixed;
      top: 89vh;
      bottom: 0px;
      z-index: 1;
      margin-bottom: 5vh;
      padding-bottom: 5vh;
    }
  }
  .tab {
    position: fixed;
    left: 0px;
    bottom: 0px;
    z-index: 1;
  }
}
</style>
